import req from "../../req";
import service from '@/utils/request'
import tool from '@/utils/tool';

// 获取设备列表
export function DeviceList(data) {
	var a = {
	  client_id:1,
	  api_token:req('Device/List'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Device/List`,
	  method: 'post',
	  data:{...data,...a}
	});
  }

// 新增设备
export function AddDevice(data) {
	var a = {
	  client_id:1,
	  api_token:req('Device/Add'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Device/Add`,
	  method: 'post',
	  data:{...data,...a}
	});
  }


  // 编辑设备
export function EditDevice(data) {
	var a = {
	  client_id:1,
	  api_token:req('Device/Edit'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Device/Edit`,
	  method: 'post',
	  data:{...data,...a}
	});
  }


    // 删除设备
export function DeleteDevice(data) {
	var a = {
	  client_id:1,
	  api_token:req('Device/Delete'),
	  token:tool.data.get("TOKEN")
	}
	return service({
	  url: `Device/Delete`,
	  method: 'post',
	  data:{...data,...a}
	});
  }


